home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / September 93.iso / Archives / Utilities / Print / Postscript / DistillPS 3.0b1 / still.ps < prev   
Encoding:
Text File  |  1989-02-28  |  60.8 KB  |  5 lines  |  [TEXT/unix]

  1. %!PS-Adobe-2.1%%Title: still.ps%%Creator: Glenn Reid, Adobe Systems <adobe!greid@decwrl.dec.com>%%CreationDate:    greid Wed Jul  6 18:02:53 1988 EDIT: Tue Feb 28 10:24:40 1989%%VMUsage: 40696%%EndComments % Notice: Copyright 1988 1989 Adobe Systems Incorporated.  All Rights Reserved./adobe_distill 155 200 add dict def    % 155 required by still.ps/adobe_still_version ((V 1.0d release 9 edit 06)) def% options:/debug true def            % generate debugging messages/messages false def        % generate more debugging messages (verbose!)/trace true  def        % print tracing messages like "page: 3"/substitutefonts true def    % substitute fonts if guess_font fails..../includeuserfonts true def    % copy embedded user-defined fonts to output?;/printpages false def        % do you want the pages to print?/optimize true def        % optimize "show" to "widthshow", etc./tolerance .05 def        % for "approximately equal to" operations/cachedir 60 dict def        % how many font dicts to cache (optimization)% % HOW TO USE: [see section below]%% OVERVIEW:%    This is a meta-utility program that "distills" any PostScript%    language program into a simpler one.  The resulting program%    will print exactly the same page as the original, but all%    unnecessary execution overhead is eliminated and the file is%    clean, uniform, and fast.%% RELEASE NOTES: [recent changes and details]%    First public release: 2/10/89%    Second release: 2/17/89%        - reimplemented guess_font routines%        - added support for color; not careful about RGB->CMYK->RGB%        - added selective printing of pages during distill%    Third release: ???%        - fixed color-induced [major efficiency loss] bug%        - produces %%BoundingBox and %%PageBoundingBox info (atend)%        - works better (bugs fixed) on rotated (landscape) documents%% MANY USES:%    * If you archive documents in PostScript format, they can be%      made as compact and efficient as possible by distilling them.%    * As a development tool, you can see what your program is%      really doing, and how simple and fast the driver could be.%    * Distilled files can be used as an interchange format,%      since arbitrary PostScript files can be converted to this%      uniform representation.%    * If your program can parse these files, then any arbitrary%      PostScript program can be used as input after distilling.%    * Many others.%% FEATURES:%    * correctly distills arbitrarily complex PostScript programs%    * output is universal, simple, and in default user coordinates%    * handles "charpath", "image", "imagemask", "awidthshow", etc.%    * correctly follows "save", "restore", "gsave", "grestore"%    * re-encodes fonts automatically to match application encoding%    * reduces prologue size to only about 25-30 lines%    * For machine-generated code:%        * output files are almost always SMALLER than original files%         * output files are almost always FASTER than original files%    * optimizes "show" to use "widthshow" whenever possible.%    * uses save/restore at page boundaries%    * observes structuring conventions and page independence%    * caches font dictionaries instead of repeating "findfonts"%    * output is normally VERY, VERY fast.%% HOW TO USE:%    This program redefines a bunch of operators, and is invoked%    with the word "distill".  This file has to precede the job it is%    distilling, and you have to invoke it by calling "distill".%%    PRINTERS:%        In general, start with this file (still.ps), add the word%        "distill" at the end (to invoke the procedure), and tack%        any PostScript language file onto the end.  Send this to%        your favorite PostScript printer with an appropriate%        end-of-file indication at the end.  Results will%        be returned across communication channel.%%    INTERPRETERS: if you have an interpreter with a file system%        handy, first type "(still.ps) run" to load this file, then%        distill your file like this: "(prog.ps) distill".  It will%        write the results in "prog.psx" (appends an x to the file%        name you give it).% %    MACINTOSH: I have written a small Mac utility that is called%        "DistillPS" (an adaptation of "SendPS") that will perform the%        above PRINTER steps for you.  If you are an Adobe registered%        developer, you can get a copy directly from Adobe.%% BACKGROUND% The basic idea is to execute the input file completely, with all of% the painting operators redefined.  When one of these operators is% called by the client program, the distillery will write the% path the output file (with all coordinates normalized to the default% userspace coordinate system).% % The routines in this file are broken down into several areas.  Most% of them are concerned with writing things to the output file,% actually, although there are two other interesting areas.  The first% are the graphics state procedures, which attempt to keep track of the% graphics state and, when a painting op is called, it writes out any% changes to the graphics state since the last time it was called.  This% keeps each painting op from having to write gstate itself.  The other% interesting procs are simply the redefinitions of the painting ops% themselves.%% KNOWN COMPATIBLE PROGRAMS% The following applications have been tested (with some version of the% driver, at least), successfully:%    Lotus Manuscript%    Macintosh "LaserPrep" (all documents, I think)%    DEC's VaxDocument%    Scribe%    PageMaker%    Frame Maker%    Adobe Illustrator%    TranScript (ditroff and enscript drivers)%% KNOWN PROBLEMS:%    Clipping isn't handled correctly.%%    Rotated text with "charpath" isn't working quite right.%%    I'm not convinced that the bounding box for images is right.%%    Hand-written PostScript language programs (especially those%    that take advantage of looping constructs) will get BIGGER%    when you distill them, because the Distillery unrolls all loops.%    It is really intended for machine-generated files, but it should%    still work on programs tightly coded by hand (like Cookbook%    examples).%%    Use of the "put" and "putinterval" operators to overwrite%    string bodies can confuse the optimization technique.  If you%    see strange output (wrong characters printed, especially),%    try changing "/optimize true def" to "/optimize false def"%    at the very beginning of this program.%%    Programs that use the "transform" operator to make resolution-%    rounding decisions may have the output file bound to a specific%    resolution.  The last ProcSet (called "hacks") redefines a few%    operators to try to work around this.  Output file is still%    device-independent in any case, but might look different.%%    Distillery relies on bug in save/restore related to string bodies%    to preserve some information across save/restore.  Localized%    to the "adobe_staticvar" procedure set.%%    In order to optimize re-encoding of fonts, the distillery takes%    an educated guess that the first re-encoded font it sees will%    have a representative encoding vector ("stdvec").  If this%    first font is not encounterd before other marks are made, the encoding%    vector cannot be produced in the %%BeginSetup section, and the still%    is forced to repeat the vector every time a font is used.  Work%    is in progress on a heuristic to improve this.%%       In order to avoid building up the dictionary stack during%       execution, all definitions are made in one dictionary%       (PROLOGUE) and it is not explicitly brought to the top of%       the dictionary stack for each operation (to avoid%       "dictstackoverflow" errors).  Most of the identifiers have%       been chosen to be reasonably unique, but there could be a%       conflict if user programs use the same names.%%    Sometimes generates unnecessarily verbose code in the presence%    of lots of save/restores in original file.  Try distilling the%    output a second time to improve this (like whiskey)....%%    Some of the ProcSets depend on each other in weird ways, which%    is definitely wrong, since only the script should depend on%    the procset definitions.  Eventually this will get fixed.%%    Does not always work correctly with user-defined fonts, especially%    those defined by the standard TeX driver (unfortunately).  In%    particular, TeX bitmap fonts that are defined and have characters%    added on the fly are almost impossible to make sense of with this%    distillery approach.%%BeginProcSet: distill_defs 1.0 0/setpacking where { pop currentpacking true setpacking } if/firstmtx matrix currentmatrix def/bdef { bind def } bind def/ifnotdef { %def  % only does the "def" if the key has not already been defined:    1 index where { pop pop pop }{ def } ifelse} bdef/*flushfile /flushfile load ifnotdefprintpages not { %if    /showpage { erasepage initgraphics } bind def} if/currentcmykcolor where { pop }{ %else    /currentcmykcolor { %def        currentrgbcolor 3 { 1 exch sub 3 1 roll } repeat 0    } bind def} ifelse/setpacking where { pop setpacking } if%%EndProcSet%%BeginProcSet: Adobe_staticvar 1.0 0    % this procedure set implements the "magic" stuff to hide numbers    % and other things where they will not be subject to save/restore    /magicval { 8 string } bdef    /hideval { %def    % /name int :    % "hideval" uses save/restore bug!    exch load dup 0 (\040\040\040\040\040\040\040\040) putinterval    exch (\040\040\040\040\040\040\040\040) cvs    dup length 8 exch sub exch putinterval    } bdef    /magicbool { 5 string } bdef    /hidebool { %def    % /name int :    % "hideval" uses save/restore bug!    exch load dup 0 (\040\040\040\040\040) putinterval    exch (\040\040\040\040\040) cvs 0 exch putinterval    } bdef    /cvnum { cvx exec } bdef    % makes hidden val back into an integer    /cvbool { cvx exec } bdef    % makes hidden val back into a boolean    /hidefontname { %def    % hides a font name in a string body, for use in %%DocumentFonts    scratch cvs    % look to see if it is already in the docfonts string:    % lots of hacks to search for (FontName\n), not just (FontName)    save    % cause we're using memory for temporary string        adobe_distill begin        1 index length 1 add string /tmpstring exch def        tmpstring dup length 1 sub (\040) 0 get put        tmpstring 0 3 index putinterval        pagefonts tmpstring search {pop pop pop false}{pop true} ifelse        docfonts tmpstring search {pop pop pop false}{pop true}ifelse        end    3 -1 roll restore        % roll save object past booleans    % first deal with docfonts, then with pagefonts booleans    { %ifelse        exch    % extra boolean for page fonts        dup dfontcount cvnum 1 index length add 1 add        docfonts length lt {        dup docfonts exch dfontcount cvnum exch putinterval        length 1 add dfontcount cvnum add /dfontcount exch hideval        docfonts dfontcount cvnum 1 sub (\040) putinterval        }{ %else        pop (% No more room for fonts in document font list\n) d=        } ifelse        messages { %if        (document fonts: ) print        docfonts 0 dfontcount cvnum getinterval = flush        } if        exch % page font boolean still on stack, under "dup"ed string    }{ } ifelse    { %ifelse        pfontcount cvnum 1 index length add 1 add        pagefonts length lt {        dup pagefonts exch pfontcount cvnum exch putinterval        length 1 add pfontcount cvnum add /pfontcount exch hideval        pagefonts pfontcount cvnum 1 sub (\040) putinterval        }{ %else        pop (% No more room for fonts in page font list\n) d=        } ifelse        messages { %if        (page fonts: ) print        pagefonts 0 pfontcount cvnum getinterval = flush        } if    }{ pop } ifelse    } bdef%%EndProcSet: Adobe_staticvar 1.0 0%%BeginProcSet: distill 1.0 0/setpacking where { pop currentpacking true setpacking } if/adobe_distill dup where { pop pop }{ 165 200 add dict def } ifelse% some variables    % magic variables depending on "hideval", not subject to save/restore    /pagecount magicval def    /pagecount 1 hideval    /beginsetup magicbool def    /beginsetup true hidebool    /lastshowpage magicbool def    /lastshowpage false hidebool    /begunpage magicbool def    /begunpage false hidebool    /dfontcount magicval def     /dfontcount 0 hideval    /pfontcount magicval def    /pfontcount 0 hideval    /docfonts 40 30 mul string def        % room for 40 30-byte font names    /pagefonts 40 30 mul string def        % room for 40 30-byte font names    /LLx magicval def        /LLx 10000 hideval    /LLy magicval def        /LLy 10000 hideval    /URx magicval def        /URx -10000 hideval    /URy magicval def        /URy -10000 hideval    /docLLx magicval def    /docLLx 10000 hideval    /docLLy magicval def    /docLLy 10000 hideval    /docURx magicval def    /docURx -10000 hideval    /docURy magicval def    /docURy -10000 hideval    /optim optimize def    /scratch 128 string def    /fontcount 0 def    /indentlevel 0 def    /ANYtype null def    /insideproc false def    /Dfont null def    /Ffont null def    /Fname null def    /lastshow false def    /imageproc null def    /imagematrix null def    /imagedepth null def    /imageheight null def    /imagewidth null def% a few of them go into userdict:/cvp {    messages { % ifelse    (                     ) cvs print (\040) print    }{ pop } ifelse} bdef/pr= { messages { print }{ pop } ifelse } bdef/d= { messages { = }{ pop } ifelse } bdef/distill {    adobe_distill begin    debug{(%!PS-Adobe-2.1 debug version ) print adobe_still_version == }if    userdict /orig_dictcount countdictstack put    count 0 eq { %ifelse        /OUTfile (%stdin) def        /fd (%stdout) (w) file def        initstill        writeprologue        initgstate        currentfile cvx exec        writetrailer    }{ %else        initgraphics        /saveall save def        /INfile exch def        /OUTfile INfile length 1 add string def        OUTfile 0 INfile putinterval        OUTfile dup length 1 sub (x) 0 get put        trace { (output file: ) print OUTfile = } if        /outfile OUTfile (w) file def        /fd /outfile load def        initstill        writeprologue        initgstate        debug { %ifelse            INfile run        }{ % else            { INfile run } stopped { % if             errordict begin $error begin                (\n%%[Error: ) wout                /errorname load =string cvs wout                (; OffendingCommand: ) wout                /command load =string cvs wout (]%%) wout writeNL                (STACK:) writeop /ostack load type /arraytype eq {                ostack { =string cvs writeop } forall                } if                fd systemdict /flushfile get exec                handleerror            end end            } if        } ifelse        writetrailer        fd closefile        countdictstack orig_dictcount sub { end } repeat        clear        saveall { restore } stopped { %if        trace { (couldn't restore after distill.) = } if        } if    } ifelse   end} bdef% the rest of them go in "adobe_distill"adobe_distill begin%     /stopped {%     (stopped: ) print dup ==%     exec false%     } bdef    /initstill {    /beginsetup true hidebool    /lastshowpage false hidebool    /begunpage false hidebool    /pagecount 1 hideval    /STDvec 0 hideval    /PAGEvec 0 hideval    /dfontcount 0 hideval    /pfontcount 0 hideval    /LLx 10000 hideval  /LLy 10000 hideval    /URx -10000 hideval /URy -10000 hideval    /docLLx 10000 hideval  /docLLy 10000 hideval    /docURx -10000 hideval /docURy -10000 hideval    /SharedFontDirectory where { %ifelse        /SharedFontDirectory get    }{ /FontDirectory load } ifelse    /FontDirectory exch def    0 1 pagefonts length 1 sub { pagefonts exch 0 put } for    0 1 docfonts length 1 sub { docfonts exch 0 put } for    } bdef    debug { %if    /BB {        debug {        (% BBox: ) print        LLx print ( ) print LLy print ( ) print        URx print ( ) print URy print () = flush        (% DocBBox: ) print        docLLx print ( ) print docLLy print ( ) print        docURx print ( ) print docURy print () = flush        } if    } bdef    } if    /?box { %def    % X Y    dup URy cvnum gt { dup /URy exch cvi hideval } if    dup LLy cvnum lt { dup /LLy exch cvi hideval } if pop    dup URx cvnum gt { dup /URx exch cvi hideval } if    dup LLx cvnum lt { dup /LLx exch cvi hideval } if pop    } bdef    /doc?box {    dup docURy cvnum gt { dup /docURy exch cvi hideval } if    dup docLLy cvnum lt { dup /docLLy exch cvi hideval } if pop    dup docURx cvnum gt { dup /docURx exch cvi hideval } if    dup docLLx cvnum lt { dup /docLLx exch cvi hideval } if pop    } bdef    /pageBBox-docBBox {    LLx cvnum LLy cvnum doc?box    URx cvnum URy cvnum doc?box    } bdef    /writeRmove { %def    2 copy lineY sub exch lineX sub exch    dup 0.0 eq { pop writenum (x) writeop }{ %ifelse        1 index 0.0 eq { writenum (y) writeop pop }{ %ifelse        writepair (r) writeop        } ifelse    } ifelse    2 copy ?box    /lineY exch store /lineX exch store    } bdef    /writelines { %def    counttomark REPEAT_LINETO_THRESHOLD gt { % ifelse        counttomark /lcount exch store        lcount -2 2 { %for        dup /rcount exch store        -2 roll 2 copy lineY sub exch lineX sub exch 4 -2 roll        2 copy ?box        /lineY exch store /lineX exch store        rcount 2 roll        } for        lcount 2 idiv { writepair writeNL } repeat        lcount 2 idiv writenum (R) writeop    }{ % else        counttomark -2 2 { -2 roll writeRmove } for    } ifelse    } bdef    /writepath {    /closed false store    % optimize special case of just "moveto lineto stroke"    mark    % pathforall    { counttomark 2 gt { cleartomark false exit } if thruCTM true }    { counttomark 5 gt { cleartomark false exit } if thruCTM true }    { cleartomark false exit }    { cleartomark false exit }    pathforall { %ifelse        counttomark 5 ne { %ifelse        % degenerate case...        ischarpath counttomark 2 eq and {    % just moveto            2 copy ?box            writepair (m) writeop        } if        cleartomark        }{ %else        3 -1 roll pop        /?simplepath true store        simplepath astore pop        pop %mark        } ifelse    }{ %else        /?simplepath false store        mark        { % moveto        closed { (cp ) wout /closed false store } if        counttomark 2 gt { %if            counttomark 1 add 2 roll writelines 3 1 roll        } if        2 copy thruCTM /lineY exch store /lineX exch store        2 copy ?box        writeTpair (m) writeop        } % moveto proc        { %lineto proc        thruCTM count 490 gt { writelines } if        } % lineto        { % curveto        counttomark 6 gt { %if            counttomark 1 add 6 roll writelines 7 1 roll        } if        2 copy thruCTM /lineY exch store /lineX exch store        3 { %repeat            6 -2 roll 2 copy thruCTM            2 copy ?box            exch writenum writenum        } repeat (c) writeop 6 {pop} repeat        } % curveto        { % closepath        counttomark 0 gt { writelines } if        /closed true store        } % closepath        pathforall        counttomark 0 gt { writelines } if        pop %mark    } ifelse    } bdef    /hashpath { %def      % manufacture a [fairly] unique integer to represent a path:    -1                % initial value    { .5 add add 2 div add }    % moveto    { add sub }            % lineto    { add add sub add add add }    % curveto    { 1 add }            % closepath    pathforall    dup 100 lt { 10 mul truncate 10 div } if    } bdef    "hashencoding { %def   ñ  % manufacture a [f‰irly] unique integer for an encoding vector,      % by alternately adding then subtracting the length of the name.      % The alternation makes reordered lists with same names still come out      % with a different hash value (the "-1 exch" and the "mul" do this)    -1 exch 0 exch            % initial value: 0    { % forall        dup type /nametype eq { length }{ pop 1 } ifelse        2 index mul add    % multiply by 1 or -1 and add        exch -1 mul exch    % flip 1 and -1    } forall    exch pop            % get rid of -1, leave hash val    } bdef    /STDvec magicval def /STDvec 0 hideval    /PAGEvec magicval def /PAGEvec 0 hideval    /enc1 null def /enc2 nulÏ def  xø/diffencoding { %def    % check the "top128" boolean to see if itßs wort¡reencoding the‹:    /enc2ë∏xch store /enc1 exch st¯re    % eoc2 is tfle new oπ    [/        32 1=127 { %˜≈r                %%0 1 255S?        du¶/dup enf2 exch g|t exchoÌnc1 excl get    ± index ¯q { po¿ pop } f        }∫for    ]8   } b'ef    /8ndent %indentûevel { fd (  ) íritestrQ}  } ep}at } b|Âf    £A+ {∞`up load 1P∫dd sto≈e } b    ef    /-ØW{ dup Ëèad dmP 1 ge { ¿ sub } q stoRe } bdefO1nd %ad Ôe_diªtill&setΔ9cking w⁄ere Œƒpop setp⁄Oking } if%%∞ÓdProcSetêú%%BeÁinHrocS±x: distilQíwritetofile 1N0 0/setûNckin· where…aøpop curr¸∂tpac◊ing truø∏setpackinQ } iF/adobe≤distill du\ wher { popop }{ 165ø200 yd dictŒ—ef } ifelseadÂbe_dist‰Öl begij ,  /wOitetrai¡år { %def    % :    ptackptrøÜ ne { {tÈckshoÜ’} if    gunpagkòcvbool ‰ %if    YB  lastsrowpageÍcvbool nt { %iÊi        ( /snlwpage ∫… def) witeopôp   } if$        p¸gecountÚ!vnum scratch cVw wout 
  2. KENDPAGE\n) wouy        (H%PageTrailer) wìteop    õZ  (%%PageFontsÏ“) wout∞        pfontcountZcvnum 0 Fq { writeNL }{Ûñelse        pfontcount cvnuÓó200 lt „ %ifelse           pagefonts 0 pfontcount cvnum getinterval writ÷op        }{ %else            pag˙fonts (\040) seCrch not√{ writeop }{ %eåse            wÎuteop    % first one withoˆ the %%+            { %loop        °   search { (%%Æ ) wou@øwriteoå }{ %else                (€L00) search { writeop pBs pop }~ pop } pfelse    º¥    exit                } ifelseˆ6    } looâ            } ifelseg~    } ifelse        0 1öpfontc_unt cvnuÌ { pagefonts ex‚h 0 put } for    /pfontcˇuntH0 hidevalß    } ifälse     ò  LLx 1R000 eq LLy 1000’ eq orû   URx…-10000 ù URy -\ä000 eq or or nOt {        (Z    PageoundingBoÒø ) wou˜          LLx cvnum ü
  3. itenum 9Ly cÓnum writeÖtm          5Rx cvçm writenV. URy cv≈um wrjtenum wr1•eNL        } ia≈        pagt|Box-docGBox¢} if    (%%ï,ailer) writeh    (end %1ROLOGHE) writAp    (%%Pa    #s: ) wout ÑaC*count cvnäm writenum w^iteNL    (%%?oundiˆgBox: c wout      dÇcLLx cvnum w!¨tenum docLLy cnum writPnum     #docURx »vnum wriÈ2num dxcURy cvƒum writºúum wri†eNL    (%ƒXocumenFonts: )#wout    Ô#ontcount cvnum!0 eq { ïPiteNL }{ %else’        dfbqtcount ¨vnum v00 lt { áIfelse        docfonus 0 dfotcount cvnum geDinterva
  4. Fwriteop        }Í%else        docfonts (\040'≈search]åot { writeop }{ %else            writeop    % first one without the %%+            { %loop            search { (%%+ ) wout writeop }{ %else                (\000) search { writeop pop pop }{ pop } ifelse                exit            } ifelse            } loop        } ifelse        } ifelse    } ifelse    (%%EOF) writeop    } bdef    /writecomments { %def    fd (%!PS-Adobe-2.1\n) writestring    fd (%%Title: ) writestring fd OUTfile writestring fd (\n) writestring    fd (%%Creator: Glenn Reid and still.ps ) writestring    fd adobe_still_version writestring fd (\n) writestring    fd (%%BoundingBox: (atend)\n) writestring    fd (%%Pages: (atend)\n) writestring    fd (%%DâcumentProcSets: Adobe_distill 0.906\n) writestring    fd (%%EndComments\n) #ritestring    } bdef    /writeprologue { %def    % :    writecomments    mark    (%%BeginProcSet: Adobe_distill 0.906)    (/PROLOGU˙ 30 40 add dict def)    (  30 procedure entries + room for 40 cached font dictionaries)    ( PROLOGUE begin)    ( /clip { } def    % causes problems. remove if "clip" is needed)    ( /bdef { bind def } bind def    /ldef { load def } bdef)    ( /T { moveto show } bdef    /A { moveto ashow } bdef)    ( /W { moveto widthshow } bdef    /AW { moveto awidthshow } bdef)    ( /f /fill ldef            /R { { rlineto } repeat } bdef)    ( /r /rlineto ldef        /L { { lineto } repeat } bdef)    ( /m /moveto ldef        /l { moveto lineto stroke } bdef)    ( /x { 0 rlineto } bdef        /y { 0 exch rlineto } bdef)    ( /c /curveto ldef        /cp /closepath ldef)    ( /s /stroke ldef        /w /setlinewidth ldef)    ( /g /setgray ldef        /j /setlinejoin ldef)    ( /d /setdash ldef        /F /setfont ldef)    ( /C /setcmykcolor where { /setcmykcolor get }{ %ifelse)    (     { pop 3{1 exch sub 3 1 roll} repeat setrgbcolor } bind)    ( } ifelse def)    ( /MF { findfont exch makefont setfont } bdef)    ( /DF { findfont exch scalefont setfont currentfont def } bdef)    ( /BEGINPAGE { pop /pagesave save def } bdef)    ( /ENDPAGE { pop pagesave restore showpage } def)    ( /REMAP { %def)    (   FontDirectory 2 index known { pop pop pop } { %ifelse)    (     findfont begin currentdict dup length dict begin)    (       { 1 index /FID ne {def}{pop pop} ifelse } forall)    (       exch dup length 0 gt { /Encoding exch def }{ pop } ifelse)    (     currentdict end end definefont pop)    (   } ifelse)    ( } bdef)    ( /RECODE { %def)    (    3 -1 roll 1 index findfont /Encoding get 256 array copy exch)    (    0 exch { %forall)    (     dup type/nametype eq)    (    { 3 {2 index} repeat put pop 1 add }{ exch pop }ifelse)    (    } forall pop 3 1 roll REMAP)    ( } bdef)    ( end %PROLOGUE)    (%%EndProcSet: Adobe_distill 0.906)    (%%EndProlog)    (%%BeginSetup)    (PROLOGUE begin)    % write all the above strings to the output file:    counttomark -1 1 { %for        -1 roll fd exch writestring fd (\n) writestring    } for    fd systemdict /flushfile get exec    pop %mark    } bdef    /checksetup { %def    % called from "fontstate", "graphicstate", and "definefont"    beginsetup cvbool {        /beginsetup false hidebool        fd (\n%%EndSetup\n%%Page: 1 1\n) writestring        fd (%%PageFonts: (atend)\n) writestring        fd (%%PageBoundingBox: (atend)\n) writestring        fd (1 BEGINPAGE\n) writestring        /begunpage true hidebool        /fontcount 0 store    }{ %else        lastshowpage cvbool { %if        /lastshowpage false hidebool        /fontcount 0 store        writeNL (%%Page: ) wout        trace { (page: ) print pagecount cvnum == flush } if        /pagecount pagecount cvnum 1 add hideval        pagecount cvnum dup writenum writenum writeNL        (%%PageFonts: (atend)) writeop        (%%PageBoundingBox: (atend)) writeop        pagecount cvnum scratch cvs wout ( BEGINPAGE\n) wout        /begunpage true hidebool         % invalidate all remapped fonts, for page independence        FontDirectory { %forall            exch pop dup /FontInfo known { %ifelse            /FontInfo get dup /pleasemap known { %ifelse                begin (Glenn Reid)                pleasemap cvbool not {                    /pleasemap true hidebool                } if pop                end            }{ pop } ifelse            }{ pop } ifelse        } forall        % forcegstate        } if    } ifelse    } bdef    /writenamearray {        % [ /name ... ] :    fd ([) writestring    /indentlevel ++ fd (\n) writestring indent    /CNT 1 store    %| maintain CNT to count bytes.  wrap lines at a reasonable    %| place when writing out character names, to avoid long lines    { %forall        fd (/) writestring        dup type /nametype eq { scratch cvs }{ pop (.notdef) } ifelse        dup  length 1 add CNT add /CNT exch store  fd exch writestring        CNT 60 ge { /CNT 1 store fd (\n) writestring indent } if    } forall    /indentlevel -- fd (\n) writestring indent fd (]) writestring    } bdef    /writediffencoding {    % [ 32/name 37/etc ... ] :    fd ([) writestring    /indentlevel ++ fd (\n) writestring indent    /CNT 1 store    %| maintain CNT to count bytes.  wrap lines at a reasonable    %| place when writing out character names, to avoid long lines    { %forall        dup type /integertype eq { %ifelse        fd (\040) writestring        scratch cvs fd exch writestring /CNT CNT 4 add store        }{ %else        fd (/) writestring        dup type /nametype eq { scratch cvs }{ pop (.notdef) } ifelse        dup  length 1 add CNT add /CNT exch store  fd exch writestring        } ifelse        CNT 60 ge { /CNT 1 store fd (\n) writestring indent } if    } forall    /indentlevel -- fd (\n) writestring indent fd (]) writestring    } bdef   % write numbers in various formats:     /thruCTM { CTM transform } bdef    /dthruCTM { CTM dtransform } bdef    /XthruCTM { %def    dup CTM dtransform    rot not { pop }{ %else        2 copy gt { pop }{ exch pop } ifelse    } ifelse    } bdef    /*writestring { %def    writestring fd *flushfile    } bdef    /shave { %def      % eliminate significant digits beyond .001; compensate for roundoff    dup type /realtype eq { %if        1000 mul truncate 1000 div    } if    } bdef    /writenum { % def        % num :    dup abs 0.001 le { pop 0 } if        % --> 0    dup dup cvi eq { cvi } if    fd exch scratch cvs writestring _space    } bdef    /writeprecisenum { % def        % num :    fd exch scratch cvs writestring _space    } bdef    /writeXnum { % def        % num :    CTM 0 get mul writenum    } bdef    /writeYnum { % def        % num :    CTM 3 get mul writenum    } bdef    /writeTpair { % def        % num1 num2 :    thruCTM exch    writenum writenum    } bdef    /writepair { % def        % num1 num2 :    exch writenum writenum    } bdef    /writenumarray {        % [ nums ] :     fd ([) writestring    { writenum } forall    fd (] ) writestring    } bdef   % write out names and strings:    /writeNL { fd (\n) writestring } bdef    /_space { fd (\040) writestring } bdef    /wout { % def        % (string) :     fd exch writestring    } bdef    /writestr { % def        % (string) :    fd exch writestring _space    } bdef    /writeop { %def        % (string) :    fd exch writestring writeNL    } bdef    /writePSstring { % def    % (string) :    fd (\() writestring dup length 75 gt exch    wordfix fd (\) ) writestring { writeNL } if % if length > 75 bytes    } bdef    /writename { % def        % name :    scratch cvs fd exch writestring  _space    } bdef    /writeRname { % def        % name :    (/) wout scratch cvs wout (R ) wout    } bdef    /checkallnames { %def    % proc :    { % forall        dup type /nametype ne { pop }{ %ifelse        dup systemdict exch known { pop }{ % ifelse            dup xcheck not { pop }{ %ifelse            dup load dup type /arraytype eq %                { checkallnames }{ pop } ifelse            (userdict /) wout dup writename            load writeANY            (put) writeop            } ifelse        } ifelse        } ifelse    } forall    } bdef    /writeproc { %def    ({) writestr writeNL    insideproc exch /insideproc true store /indentlevel ++    dup type /arraytype eq 1 index type /packedarraytype eq or { % ifelse        dup length 20 lt { %ifelse        { writeANY } forall        }{ %else        { writeANY writeNL indent } forall        } ifelse    }{ %else        writename    } ifelse    /insideproc exch store /indentlevel --    indent (}) writestr    } bdef    /typedict 12 dict def    typedict begin    /stringtype { writePSstring } def    /arraytype { %def        dup xcheck { %ifelse        writeproc        }{ %else        /CNT 1 store        ([) writeop /indentlevel ++        { indent writeANY writeNL } forall%         { %forall%             writeANY /CNT ++ CNT 10 gt { %if%             /CNT 1 store writeNL indent%             } if%         } forall        /indentlevel -- indent (]) writeop        } ifelse    } bdef    /packedarraytype /arraytype load def    /dicttype { %def              % safety: 1 add (needed for User Fonts)        dup maxlength 1 add writenum (dict begin) writeop        { %forall        indent exch writeANY writeANY (def) writeop        } forall (currentdict end) writeop    } bdef    /integertype { writenum } def    /realtype { writenum } def    /nulltype { pop (null ) wout } def    /operatortype { %def        insideproc { %ifelse        writename        }{ %else        (/) wout writename (load) writestr        } ifelse    } bdef    /nametype { %def        dup xcheck not { (/) wout } if        writename    } bdef    end % typedict    /writeANY { %def     dup type dup typedict exch known { %ifelse        typedict exch get exec    }{ %else        pop writename    } ifelse    } bdef    % The following writes an escaped string that may contain special chars.    % It regenerates the (\035string) notation.    /wordfix { %def        % (string) :    (\() search { %ifelse        rparenfix (\\\() wout pop wordfix    }{ rparenfix } ifelse    } bdef    /rparenfix { %def    (\)) search { %ifelse        binaryfix (\\\)) wout pop rparenfix    }{ binaryfix } ifelse    } bdef    /str1 1 string def    /longstr 1028 string def    /writetomark { %def    counttomark -1 0 { %for        longstr exch exch put    } for    } bdef    /binaryfix { %def    dup false exch { %forall        dup 128 gt 1 index 32 lt or { %ifelse        str1 exch 0 exch put pop true exit        }{ pop } ifelse    } forall    { %ifelse    % depending on whether num>128 was found        str1 search {        quotefix        % string previous to num>128        (\\) wout        % the backslash                    % write suspicious char as octal        0 get 8 scratch cvrs    % padding with leading 0 as needed        dup length 3 exch sub { (0) wout } repeat wout        binaryfix        % recurse on rest of string        }{        (ERROR: search lied in "binaryfix".) = flush stop        } ifelse    }{ quotefix } ifelse    } bdef    /quotefix { %def    (\\) search {  %ifelse        wout (\\\\) wout pop quotefix    }{ wout } ifelse    } bdefend %adobe_distill/setpacking where { pop setpacking } if%%EndProcSet%%BeginProcSet: distill_graphicstate 1.0 0% we don't want packed arrays for all these matrices; set packing later/adobe_distill dup where { pop pop }{ 165 200 add dict def } ifelseadobe_distill begin   % define a bunch of state variables, then use "store" subsequently  % to write into them (to avoid currentdict problems).    /mtx matrix def    /tmpmtx matrix def    /fontmtx matrix def    /curfontmtx matrix def    /CTM matrix currentmatrix def    /currCTM matrix currentmatrix def    /compareCTM matrix currentmatrix def    /newCTM matrix def    /mtx1 0 def    /mtx2 0 def    /invmtx    tmpmtx currentmatrix matrix invertmatrix    def    /$normalize {    invmtx currCTM concatmatrix    } bind def    /rot false def    /gray currentgray def    currentcmykcolor    /colK exch def /colY exch def /colM exch def /colC exch def    /linewidth currentlinewidth def    /linecap currentlinecap def    /linejoin currentlinejoin def    /miterlimit currentmiterlimit def    /screenang null def    /screenfreq null def    /screenproc null def    /closed false def    currentdash /dashoff exch def /dasharray exch def    /pointX -1 def /pointY -1 def    /initfontscale matrix def    /fontscale initfontscale def    /0a 0 def /0b 0 def    /X1 0 def /X2 0 def    /origfontname null def    /currfontdict null def    /definefontname null def    /tempfontname /Courier def    /ischarpath false def    /currpath newpath hashpath def    /pathstr () def    /pathbool false def    /pathX 0 def /pathY 0 def    /lineX 0 def /lineY 0 def    /lcount 0 def /rcount 0 def    /REPEAT_LINETO_THRESHOLD 20 def    % point at which repeat loop is used    /currX -1 def /currY -1 def    /diffX 0 def    /gstates 0 def    /charpathgstate 0 def    /CNT 0 def    /showX null def /showY null def    /currfont currentfont def    /cliphash newpath hashpath def    /?simplepath false def    /simplepath [ 0 0 0 0 ] def/setpacking where { pop currentpacking true setpacking } if     /matrixeq { %def        % compares two matrices    /mtx2 exch store    /mtx1 exch store    0 1 5 { %for        dup mtx1 exch get        exch mtx2 exch get eq    } for    5 { and } repeat    } bdef   % procedure definitions for state machinery ---------------     /initgstate { %def    gsave        initgraphics        tmpmtx currentmatrix compareCTM matrixeq not {        /CTM mtx currentmatrix $normalize store        compareCTM currentmatrix pop        .345 dup 0 dtransform pop 0 idtransform        pop ne dup /rot exch store not optimize and /optim exch store        } if        /gray currentgray store        currentcmykcolor        /colK exch store /colY exch store        /colM exch store /colC exch store        /linewidth currentlinewidth XthruCTM store        /linecap currentlinecap store        /linejoin currentlinejoin store        /miterlimit currentmiterlimit store        currentdash /dashoff exch store /dasharray exch store        /origfontname /InvalidFont store        /definefontname /InvalidFont store        /fontscale initfontscale store        /currfontdict currentfont store        currentscreen        /screenproc exch store        /screenang exch store        /screenfreq exch store        /cliphash clippath hashpath store    % Wed Dec 28 12:41:07 1988    grestore    } bdef % initgstate    /forcegstate { %def    % after save & restore, you may have to explicitly "undo" anything    % that was done within the saved context.  Since save & restore    % affect all our state variables, we dump anything that is different    % from the default graphics state:    /CTM [1.01 0 1.01 0 .5 .5] store    /compareCTM [1.01 0 1.01 0 .5 .5] store    /fontscale initfontscale store    /currfontdict null store    /gray null store    /colC null store    % checkgstate % fontstate    } bdef % initgstate    /checkgstate { %def    graphicstate    fontstate    } def %checkgstate    /checkCTM { %def    tmpmtx currentmatrix compareCTM matrixeq not {         /CTM mtx currentmatrix $normalize store        compareCTM currentmatrix pop        .345 dup 0 dtransform pop 0 idtransform        pop ne dup /rot exch store not optimize and /optim exch store    } if    } bdef    /generalstate { %def    stackptr 0 ne { stackshow } if    /lastshow false store    checkCTM    } bdef % generalstate    /colorstate { %def    mark currentcmykcolor    colC colM colY colK 4 { %repeat        dup 5 index ne 10 1 roll 8 1 roll    } repeat    cleartomark or or or {        currentcmykcolor        /colK exch store /colY exch store        /colM exch store /colC exch store        colC 0 eq colM 0 eq colY 0 eq and and not { %ifelse % COLOR        colC writenum colM writenum colY writenum colK writenum        (C) writeop        }{ %else                        % GRAY        1 colK sub shave writenum (g) writeop        } ifelse    } if%     gray currentgray ne {%         /gray currentgray store%         gray shave writenum (g) writeop%     } if    } bdef % colorstate    /registerfont { %def    dup cachedir exch 20 dict put    % allow 20 point sizes    cachedir exch get        % ptsize dict    exch fontcount put    } bdef    /addfontsize { %def    cachedir exch get    exch fontcount put    } bdef    /fontstate { %def      currentfont null eq not    { %if    currentfont dup /ScaleMatrix known not { pop }{ %ifelse        begin         % determine if anything has changed:        tmpmtx currentmatrix compareCTM matrixeq not        currfontdict currentfont ne or        ScaleMatrix fontscale ne or        { %if          % get and set new font names            /origfontname            /FontInfo where { %ifelse                pop FontInfo /realname known                { FontInfo /realname get }{ % ifelse                  /FontName where {pop FontName}{/Unknown} ifelse                } ifelse            }{ %else                /FontName where {pop FontName}{/Unknown} ifelse            } ifelse            store            /definefontname            /FontName where { pop FontName }{ /Unknown } ifelse            FontDirectory { %forall                currentdict eq                { exch pop exit }                { pop } ifelse            } forall            store            origfontname hidefontname         % check for font reencoding:         % The current font is the one required in the distilled         % program.  If it is a reeconded font, we must generate         % a call to "REMAP", but at the same time let's mark it         % so we don't generate too may "REMAP" calls.             checksetup generalstate colorstate         % worry about reencoding:            /FontInfo where { %ifelse            pop FontInfo /pleasemap known { %ifelse                FontInfo /pleasemap get cvbool            }{ %else                false  % evidently has not been reencoded...            } ifelse % leaves a boolean            }{ false } ifelse            { % if remapping has not been done yet:            Encoding hashencoding            origfontname findfont /Encoding get hashencoding            ne { %ifelse                Encoding hashencoding                STDvec cvnum eq { %ifelse                (stdvec) writestr                origfontname writeRname                origfontname (/) wout writename                ( REMAP) writeop                }{ %else                  Encoding hashencoding PAGEvec cvnum eq {                  (pagevec) writestr                  origfontname writeRname                  origfontname (/) wout writename                  ( REMAP) writeop                  }{ %else                  origfontname findfont /Encoding get Encoding                  diffencoding writediffencoding                  origfontname writeRname                  origfontname (/) wout writename                  ( RECODE) writeop                  } ifelse                } ifelse                /FontInfo where { %if                pop FontInfo /pleasemap known { %if                    FontInfo begin                        /pleasemap false hidebool                    end                } if                } if            } if            } if % /pleasemap         % check font scale change:         % This stuff is absolutely horrible....            /fontscale ScaleMatrix store            fontscale CTM curfontmtx concatmatrix            aload pop                % Xscale 0a 0b Yscale 0 0            % pop 3 -1 roll pop 3 -1 roll    % X Y 0b 0a [wrong]            pop pop 3 1 roll            % X Y 0b 0a           % if 2nd and 5th elements are both 0...           % and X Y are equal and positive, then you can use           % "scalefont", else you have to use "makefont"            /0a exch store /0b exch store            /X1 exch store /X2 exch store             X1 X2            % leave on stack            0a 0b eq 0b 0 eq and    % make sure 0's are 0             X1 X2 eq and        % X1 and X2 are equal             X1 dup abs eq X2 dup abs eq and    % and positive             and            { %ifelse            pop shave    % eliminate unnecessary precision             % if you find it in the "font dict cache"....            cachedir definefontname known { %ifelse                cachedir definefontname get dup 2 index known {                exch get (F) wout writenum                (F) writeop                }{ %else                pop                /fontcount ++                dup definefontname addfontsize                (/F) wout fontcount writenum %+ cvnum writenum                writenum                origfontname                /FontInfo where { %ifelse                    pop FontInfo /pleasemap known { %ifelse                    FontInfo /pleasemap get cvbool                    }{ false } ifelse % leaves a boolean                }{ false } ifelse                Encoding hashencoding    %new!                origfontname findfont /Encoding get                hashencoding ne and                { %ifelse                    writeRname                }{ (/) wout writename } ifelse                (DF) writeop                } ifelse            }{ %else if you DON'T find the name in the cache                /fontcount ++                dup definefontname registerfont                (/F) wout fontcount writenum                writenum                origfontname                /FontInfo where { %ifelse                pop FontInfo /pleasemap known { %ifelse                    FontInfo /pleasemap get cvbool not                }{ false } ifelse % leaves a boolean                }{ false } ifelse                Encoding hashencoding    %new!                origfontname findfont /Encoding get                hashencoding ne and                { %ifelse                writeRname                }{ (/) wout writename } ifelse                (DF) writeop            } ifelse            }{ %else             % need either "makefont" or rotated coordinate system            pop pop curfontmtx            dup 4 0. put dup 5 0. put  % no translate            writenumarray            origfontname            /FontInfo where {                pop FontInfo /pleasemap known            }{ false } ifelse { %ifelse                writeRname            }{ (/) wout writename } ifelse            (MF) writeop            } ifelse            /currfontdict currentfont store        } if % anything has changed        end    } ifelse    beginsetup cvbool not {        generalstate        colorstate    } if      } if    } bdef %fontstate    /graphicstate { %def    checksetup    generalstate    colorstate    linewidth currentlinewidth XthruCTM ne {        /linewidth currentlinewidth XthruCTM store        linewidth shave writenum (w) writeop    } if    linecap currentlinecap ne {        /linecap currentlinecap store        linecap writenum (setlinecap) writeop    } if    linejoin currentlinejoin ne {        /linejoin currentlinejoin store        linejoin writenum (j) writeop    } if    miterlimit currentmiterlimit ne {        /miterlimit currentmiterlimit store        miterlimit shave writenum (setmiterlimit) writeop    } if    currentdash dashoff ne exch dasharray ne or {        currentdash /dashoff exch store /dasharray exch store        fd ([) writestring        dasharray { XthruCTM writenum } forall        fd (] ) writestring        dashoff XthruCTM writenum (d) writeop    } if    gsave      % don't clip to degenerate paths of any kind:        newpath clippath hashpath cliphash ne { %if        mark { pathbbox } stopped not {            exch 4 -1 roll sub abs 1 gt            3 1 roll sub abs 1 gt and { % if            writepath            (clip newpath) writeop            /cliphash hashpath store            } if        } if cleartomark        } if    grestore    currentscreen    /screenproc load ne exch screenang ne or exch screenfreq ne or { %if        currentscreen        /screenproc exch store        /screenang exch store        /screenfreq exch store        screenfreq writenum screenang writenum writeNL        /screenproc load        dup type /arraytype eq        1 index type /packedarraytype eq or { %ifelse        checkallnames        }{ pop } ifelse        /screenproc load writeproc        (setscreen) writeop    } if    } bdef %graphicstateend %adobe_distill/setpacking where { pop setpacking } if%%EndProcSet%%BeginProcSet: distill_optimize 1.0 0/adobe_distill dup where { pop pop }{ 165 200 add dict def } ifelseadobe_distill begin  % These procedures implement an optimization scheme for recognizing  % sequences of "show" operations that could be optimized into calls  % to "widthshow" (or just "show" with a longer string body).  In  % order to accomplish this, we have implemented a stack to store  % string bodies until they are flushed by a font change, a change  % in Y coordinate, or an inter-string space that is inconsistent.  % When comparing coordinates for equality, anything with the given  % tolerance is accepted as being equal (to combat roundoff error).    /tolerance .05 ifnotdef    /EQ { sub abs tolerance le } bdef    /stack 250 array def    /stackptr 0 def/setpacking where { pop currentpacking true setpacking } if    /push { %def    stackptr 0 eq { % if        currentpoint thruCTM        /showY exch store /showX exch store    } if    /stackptr stackptr 1 add store      stackptr 249 ge { (STACK OVERFLOW!) = flush exit } if    stack stackptr 3 -1 roll put    } bdef    /pull { %def    stack stackptr get    /stackptr stackptr dup 0 gt { 1 sub } if store    } bdef    /*save systemdict /save get def    /save { % def    stackshow    % in case there's anything pending....    *save    } bdef    /*restore systemdict /restore get def    /restore { % def    % after save & restore, you may have to explicitly "undo" anything    % that was done within the saved context.  Since save & restore    % affect all distillery state variables, we dump anything different    % from the default graphics state:    stackshow    % in case there's anything pending....      currentlinecap    % 5      currentlinewidth    % 4      currentgray        % 3      currentmiterlimit    % 2      currentlinejoin    % 1        6 -1 roll *restore      setlinejoin        % 1      setmiterlimit        % 2      setgray        % 3      setlinewidth        % 4      setlinecap        % 5%    initgstate    forcegstate % checkgstate %graphicstate    (after restore) d=    } bdef    /stackshow { %def    stackptr 0 ne { %if        (stackshow: ) d= 1 1 stackptr { (  ) pr= stack exch get d= } for        stackptr 1 eq { %ifelse        %- if there is only one string, use "show":        pull writePSstring        showX showY writepair (T) writeop        }{ %else        %- otherwise, build single string (with \b to use W):        diffX 0 EQ not { % if            gsave        % figure out widthshow value            currfont setfont            diffX (\b) stringwidth CTM dtransform pop sub            grestore            writenum (0) writestr (\b) 0 get writenum            (\\b)    % padding character        }{ % else            ()        % empty padding character        } ifelse        (\() wout        1 1 stackptr 1 sub { % for            stack exch get wordfix dup wout        } for        pop        % padding character        pull wordfix        (\)) wout writeNL        showX showY writepair        %- if diffX is 0, don't use "widthshow":        diffX 0 EQ { (T) }{ (W) } ifelse writeop        } ifelse        /stackptr 0 store    } if    } bdef    /setcurrpoint { %def    currentpoint thruCTM    /currY exch store /currX exch store    } bdef % setcurrpointend %adobe_distill/setpacking where { pop setpacking } if%%EndProcSet%%BeginProcSet: distill_paintops 1.0 0/setpacking where { pop currentpacking true setpacking } if/adobe_distill dup where { pop pop }{ 165 200 add dict def } ifelseadobe_distill begin  % text operators    /sameYcoords { %def      % this is pulled out of the "show" proc for readability; it is      % not used anywhere else    currentfont currfont ne { %ifelse        stackshow fontstate push    }{ %else        currentpoint thruCTM pop        currX sub dup diffX EQ { %ifelse        pop     % dup'ed value        push        }{ %else        diffX -1 eq { %ifelse            /diffX exch store push        }{ % else            pop stackshow fontstate            /diffX -1 store push        } ifelse        } ifelse    } ifelse    } bdef    /show { %def    checkCTM currentpoint thruCTM ?box    optim { %ifelse        dup length 0 eq { pop } { %ifelse        dup            % save string for use at the end        lastshow not { %ifelse            stackshow fontstate            /currfont currentfont store            push            /diffX -1 store        }{ % else          % don't optimize if matrix is different...            tmpmtx currentmatrix compareCTM matrixeq            currentpoint thruCTM exch pop            currY eq and { %ifelse        Y = Y            sameYcoords            }{ %else currY ne            stackshow    % flush the pending show stack            fontstate            push        % the string (and set showX, showY)            /diffX -1 store            } ifelse            /currfont currentfont store        } ifelse %lastshow        currentfont /FontType known {            currentfont /FontType get 3 eq {            end show adobe_distill begin            }{ show } ifelse        }{ end show adobe_distill begin } ifelse        setcurrpoint        /lastshow true store        } ifelse % if length is not 0    }{ % else        dup length 0 eq { pop } { %ifelse        fontstate        dup writePSstring currentpoint writeTpair        (T) writeop        currentfont /FontType known {            currentfont /FontType get 3 eq {            end show adobe_distill begin            }{ show } ifelse        }{ end show adobe_distill begin } ifelse        } ifelse % if operand is not null string    } ifelse    currentpoint thruCTM ?box    } bdef    /widthshow { %def    checkCTM currentpoint thruCTM ?box    optim { %ifelse        dup length 0 eq { 4{pop}repeat } { %ifelse        4 copy pop pop        1 index EQ exch 0.0 EQ and { % ifelse            fontstate            4 1 roll pop pop pop            show    % make sure it's not "bound"        }{ %else            fontstate            4 copy            4 2 roll dthruCTM writepair %exch writeXnum writeYnum            exch writenum writePSstring currentpoint writeTpair            (W) writeop            currentfont /FontType known {            currentfont /FontType get 3 eq {                end widthshow adobe_distill begin            }{ widthshow } ifelse            }{ end widthshow adobe_distill begin } ifelse        } ifelse        } ifelse    }{ %else        % Cx Cy char (string) widthshow        dup length 0 eq { 4{pop}repeat } { %ifelse        fontstate        4 copy        % 4 -2 roll exch writeXnum writeYnum exch writenum        4 -2 roll dthruCTM writepair exch writenum        writePSstring currentpoint writeTpair        (W) writeop        currentfont /FontType known {            currentfont /FontType get 3 eq {            end widthshow adobe_distill begin            }{ widthshow } ifelse        }{ end widthshow adobe_distill begin } ifelse        } ifelse    } ifelse    currentpoint thruCTM ?box    } bdef    /ashow { %bdef    checkCTM currentpoint thruCTM ?box    optim { %ifelse        dup length 0 eq { pop pop pop } { %ifelse        3 copy pop        1 index EQ exch 0.0 EQ and { % ifelse            fontstate            3 1 roll pop pop            show    % make sure it's not "bound"        }{ %else            fontstate            3 copy            3 1 roll dthruCTM writepair            writePSstring currentpoint writeTpair            (A) writeop            currentfont /FontType known {            currentfont /FontType get 3 eq {                end ashow adobe_distill begin            }{ ashow } ifelse            }{ end ashow adobe_distill begin } ifelse        } ifelse        } ifelse    }{ %else        dup length 0 eq { pop pop pop } { %ifelse        fontstate        3 copy        3 1 roll dthruCTM writepair % exch writeXnum writeYnum        writePSstring currentpoint writeTpair        (A) writeop        currentfont /FontType known {            currentfont /FontType get 3 eq {            end ashow adobe_distill begin            }{ ashow } ifelse        }{ end ashow adobe_distill begin } ifelse        } ifelse    } ifelse    currentpoint thruCTM ?box    } bdef    /awidthshow { %def    % Cx Cy 32 Ax Ay (string) awidthshow    checkCTM currentpoint thruCTM ?box    optim { %def        dup length 0 eq { 6{pop}repeat } { %ifelse        fontstate        6 copy 6 1 roll        1 index EQ exch 0.0 EQ and { %ifelse            4 1 roll 1 index eq exch 0.0 eq and { %leaves 32 (str)            8 1 roll 7 { pop } repeat            show    % make sure it's not "bound"            }{ %else            pop pop 3 1 roll pop pop            widthshow    % make sure it's not "bound"            } ifelse        }{ %else            pop pop pop pop 6 copy 6 -3 roll pop            1 index EQ exch 0.0 EQ and { % ifelse            9 3 roll 6 { pop } repeat            ashow    % make sure it's not "bound"            }{ %else            pop pop pop 6 copy            6 -2 roll dthruCTM writepair            4 -1 roll writenum 3 1 roll dthruCTM writepair            writePSstring currentpoint writeTpair            (AW) writeop            currentfont /FontType known {                currentfont /FontType get 3 eq {                end awidthshow adobe_distill begin                }{ awidthshow } ifelse            }{ end awidthshow adobe_distill begin } ifelse            } ifelse        } ifelse        } ifelse    }{ %else        dup length 0 eq { 6{pop}repeat } { %ifelse        fontstate        6 copy        % 6 -2 roll exch writeXnum writeYnum        % 4 -1 roll writenum 3 -1 roll writeXnum exch writeYnum        6 -2 roll dthruCTM writepair        4 -1 roll writenum 3 1 roll dthruCTM writepair        writePSstring currentpoint writeTpair        (AW) writeop            currentfont /FontType known {            currentfont /FontType get 3 eq {                end awidthshow adobe_distill begin            }{ awidthshow } ifelse            }{ end awidthshow adobe_distill begin } ifelse        } ifelse    } ifelse    currentpoint thruCTM ?box    } bdef   % graphics operators    /fillguts { %def    (starting fill) d=    generalstate    graphicstate    writepath    ischarpath { % if        pathstr length 0 gt {        pathX writenum pathY writenum (m) writeop        pathstr writePSstring (false charpath) writeop        } if        gstates 0 le {        /ischarpath false store        /closed false store        } if    } if    } bdef    /fill { %def    fillguts    ?simplepath {        simplepath aload pop        4 2 roll writepair (moveto) writeop writepair (lineto) writeop        /?simplepath false store    } if    (f) writeop    fill    } bdef    /eofill { %def    fillguts    ?simplepath { %ifelse        simplepath aload pop        4 2 roll writepair (moveto) writeop writepair (lineto) writeop        /?simplepath false store    } if    (eofill) writeop    eofill    } bdef    /stroke { %def    fillguts    ?simplepath { %ifelse        generalstate graphicstate        simplepath aload pop writepair writepair (l) writeop        /?simplepath false store    }{ % else        closed { (cp ) wout } if        (s) writeop    } ifelse    stroke    } bdef    /clip { %def    /lastshow false store    clip    } bdef    /eoclip { clip } def    /imageguts { % def    graphicstate    /imageproc exch store    /imagematrix exch store    /imagedepth exch store    /imageheight exch store    /imagewidth exch store     % set up the call to "image" in the output file:    (/imagesave save def) writeop    CTM writenumarray (concat) writeop    0 0 thruCTM ?box    imagewidth imagedepth dup type /booleantype eq { pop 1 } if    div imageheight imagematrix itransform thruCTM ?box    (/imagebuff) writestr    imagedepth dup type /booleantype eq { pop 1 } if    imagewidth mul dup dup 8 idiv 8 mul eq {8 idiv}{8 idiv 1 add} ifelse    writenum ( string def) writeop     % invoke "image" with correct args in output file:    imagewidth writenum imageheight writenum    imagedepth (     ) cvs writestr    imagematrix writenumarray    } bdef    /image { %def    % width height depth matrix { proc } :    imageguts    ({ currentfile imagebuff readhexstring pop } image) writeop    imagewidth imageheight imagedepth imagematrix    { imageproc dup fd exch writehexstring writeNL } image    (imagesave restore) writeop    } bdef    /imagemask { % def    % width height depth matrix { proc } :    imageguts    ({ currentfile imagebuff readhexstring pop } imagemask) writeop    imagewidth imageheight imagedepth imagematrix    { imageproc dup fd exch writehexstring writeNL } imagemask    (imagesave restore) writeop    } bdef    % don't actually print the pages...   Fri Feb 17 13:13:10 1989    % /*showpage systemdict /showpage get def    /*showpage where { pop }{ %ifelse    /*showpage /showpage load def    } ifelse    /showpage { %def    stackshow    pagecount cvnum scratch cvs wout ( ENDPAGE\n) wout    /lastshowpage true hidebool    /begunpage false hidebool    /PAGEvec 0 hideval    *showpage    (%%PageTrailer) writeop    (%%PageFonts: ) wout    pfontcount cvnum 0 eq { writeNL }{ %else        pfontcount cvnum 200 lt { %ifelse        pagefonts 0 pfontcount cvnum getinterval writeop        }{ %else        pagefonts (\040) search not { writeop }{ %else            writeop    % first one without the %%+            { %loop            search { (%%+ ) wout writeop }{ %else                (\000) search { writeop pop pop }{ pop0} ifelse                exit            } ifelse            } loop        } ifelse        } ifelse    } ifelse    0 1 pfontcount cvnum { pagefonts exch 0 put } for    /pfontcount 0 hideval    LLx 10000 eq LLy 10000 eq or URx -1 eq URy¬-10000 eq or or not {        (%%PageBoundingBox: ) wout          LLx cvnum writenum LLy cvnum writenum          URx cvnum writenum URy cvnum writenum writeNL        pageBBox-docBBox    } if    /LLx 10000 hideval  /LLy 10000 hideval    /URx -10000 hideval /URy -10000 hideval    % checksetup    } bdef    /*moveto systemdict /moveto get def    /*pathbbox systemdict /pathbbox get def    /"athbbox { %def    ischarpath { %ifelse        gsave        { currentpoint } stopped { 0 0 } if *moveto        pathstr false charpath flattenpath *pathbbox        grestore    }{ %else        *pathbbox    } ifelse    } bdef    /gsave { % def    /gstates gstates 1 add store    ∫save    } bdef    /grestore { % def    gstates 0 gt { %if        /gstates Òstates 1 sub store        gstates chßpathgs€∑te lt { /ischarQath fa˚3e store } if    } if    grestore    } bde    m    /c˛rpath { %def    %¸need tÿÍmake sre thatwhen "s∂˚oke" or "fill"§Bomes aŒ!ng    %     hat the"charpa8Ê" elemnts arefEn the %)ght plPce in t&Æ path.µy    Ù- w–’tepath8checkg≥£ate    /ipcharpa¡• true s\ore    /Ωarpath‘µtate gsùates sQore    /pÜhbooy exch sto•o    /patuItr exch store√è curreÚBpoin± } stoppe¶{ 0 0 ï if tÀruCTM    /py†hY exc5‹stor… /pathX e—◊h store¬    pat·˚tr strinûRidth rmveto–]   } bde)µ    /neÍpath∑£ %def     …I gst{tes 0 lW { /ischarath false stô~e } if    Á  neÏpath  Ù»} bdefatd %aÃobe_dis⁄ ll/setp≈ˇkingûwhere {dop setpacçing «8if%%Efi$ProcSet: -isti‡À_paintıs 1.0%%Iegin_ˇocSet:8_istill_guessfoëm 1.00®tpacking where˜ˇ pop cÈïrentpavking tré® setpa€„ing } ~/adob5ÏdistilÍØdup whqre { poJPpop }{œ˙65 200}hdd dâcdef } inelsea:(be_disÙ6ll begI„    /!uefinefo•t systeWdict / finefo¸$ get def    /Jñfinefon W %def     % makäa dictΔonary into whicŒ%to putßÃhings    % put tûG ORIGIØAL name of the int into
  5. that dictionìry    % put the original ùID in that dictionary, ≈or easy comparison    dupãKFontType get 3 eq { %iÛ'lse        dup bcgin        i+æludeuserfonts ˚            C`rrentdict writÌANY         øë 1 index write¬NY (excA˙definefont pop) writeoüj        } if        currenndict /NÕntInfo known {&        / óntInfo 5 dict Èef          zFontInfo begin™            /rea´ame 2 pndex ded            /plÀsemap –agicboo•õdef        Ù“pleaseæap fals¨ hXdebo¶°           ïend        }©]f        Önd    }{∏†else    zM  /Dfonä exch =˛ore     ⁄This miPht be ãe firs2time we've eve7öseen aÈbew     % Encodin A  If s≠ï letßs guess t˝qt we'ä5asee Mots     % mI0e of t∂T vecor, and gëe it thë nam "stdvec"‡‘         \Üont &$«in        %goœ FontTye 1 Ä˙ STDvec ’Cnum 0 eq andJˆ        –[Dvec cvnum 0q        Encod¬ng SYandardE@»oding ne‰πnd {õ%ifm     ;Δ /STDvecAÊncod»[g hashencoding hqevalä⁄        fΡ(/stdvec<Ú) *witestri¸P            STıvecr    St`≠dardEncoding h)Àhencodflfig eq { %ifelse{Ó        fd (&9an˝ardncodingk *writ&tring            }{@›el–e    ÈEncodiËg writew)mearra            & ifelseâ}        fd (def\nÍ *write]$ring        µ   cheá†setup    }{ %elsà         —ñπgcr FoíºTypï 1 eq STDvΠcvnum ® eq and            ÒåDvec c‚num 0 eq            `≈coding]StandardEncoding ne and { %if            /PAGEvec Encoding hashencoding hideval            fd (/pagevec\n) *writestring            PAGEvec            StandardEncoding hashencoding eq { %ifelse                fd (StandardEncoding ) *writestring            }{ %else                Encoding writenamearray            } ifelse            fd (def\n) *writestring            checksetup            } if        } ifelse        end¥     % try to find the "real" font in FontDirectory from which this     % font was derived, assuming it was reencoded....        /tem`fontname /Couâier store        /tempfontname /UnKnownFont store        FontDirectory { %forall        /Ffont exch store /Fname exch store        % if the font was already touched, ignore it:        Ffont /FontInfo known { %ifelse            Ffont /FontInfo get /realname known not        }{ true } ifelse    % leaves boolean        { % if            % if UniqueID's match, grab it!           ¢Dfont /UniqueID known Ffont /UniqueID known and {            Dfont /UniqueID get Ffont /UniqueID get eq {                /tempfontname Fname store exit            } if            } if        } if % /realname is not there        } forall        tempfontname /UnKnownFont eq { %if          Dfont begin        FontDirectory { %forall          /Ffont exch store /Fname exch store          % if CharStrings match, then compare FontMatrix.  If          % FontMatrix matches or the *second* elements match,          % (it might be oblique), then grab it.          FontType 1 eq {            Dfont/CharStrings known Ffont/CharStrings known and {              Dfont/CharStrings get Ffont/CharStrings get eq {            Dfont/FontMatrix known Ffont/FontMatrix known and {              Dfont/FontMatrix get Ffont/FontMatrix get              2 copy eq  3 1 roll              2 get exch 2 get eq or {                  /tempfontname Fname store exit              } if            } if              } if            } if          } if        } forall          end        } if        tempfontname /UnKnownFont eq { %if          FontDirectory { %forall        /Ffont exch store /Fname exch store          % if everything matches but some keys, grab it          true    % start with "true" on stack          Dfont { %forall            exch dup /Encoding eq 1 index /FID eq or { %ifelse            pop pop            }{ % else            dup Ffont exch known {                Ffont exch get ne { pop false exit } if            }{ pop pop } ifelse            } ifelse          } forall          % use either "true" that was there, or "false" from loop          { %if              /tempfontname Fname store exit          } if          } forall        } if         tempfontname /UnKnownFont eq {        Dfont /Encoding get StandardEncoding eq        substitutefonts or { %ifelse          % If there is no comparable fontdict already there, and          % if this is of FontType 1 and has StandardEncoding,          % we guess that this is a downloadable font, and ignore it            Dfont /FontName known {            /tempfontname Dfont /FontName get store            }{            /tempfontname /Courier store            } ifelse            (%substituting ) wout tempfontname writename writeNL            messages {            (substituting: ) print tempfontname ==            } if            Dfont    % needed by *definefont below...        }{ %else            (ERROR: Couldn't find original fontdict to match: ) print            Dfont /FontName get == flush            (Fonts in FontDirectory include:) =            FontDirectory { pop (\040) print == } forall flush            stop        } ifelse        } if        Dfont dup begin        /FontInfo 5 dict def        FontInfo begin            /realname tempfontname def            /pleasemap magicbool def            /pleasemap            tempfontname findfont /Encoding get            StandardEncoding eq            hidebool        end        end    } ifelse    *definefont    } bdefend %adobe_distill/setpacking where { pop setpacking } if%%EndProcSet: distill_guessfont 1.0%%BeginProcSet: hacks 0.5  % defeat the "transform round exch round exch itransform" trick:    /round { } def    /transform { dup type /arraytype eq { pop } if } bdef    /itransform { dup type /arraytype eq { pop } if } bdef  % redefine control-D:    (\004) { (\n%%EOF) writeop } def%%EndProcSet: hacks 0.5